#ifndef ELEMENTS_ITEM_USER_STATE_H
#define ELEMENTS_ITEM_USER_STATE_H

#include "common/elements/item_type.h"
#include "common/more/time.h"

#include "element.h"

namespace Elements
{

struct ItemUserState : public Element
{
    ItemUserState() = default;
    ItemUserState(const ItemUserState& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* const other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    unsigned itemId() const;
    void setItemId(unsigned value);

    unsigned userId() const;
    void setUserId(unsigned value);

    unsigned stateId() const;
    void setStateId(unsigned value);

    std::time_t timestamp() const;
    void setTimestamp(const std::time_t& value);

private:
    unsigned m_itemId = 0;
    unsigned m_userId = 0;
    unsigned m_stateId = 0;
    std::time_t m_timestamp = 0;

};

typedef std::shared_ptr<ItemUserState> ItemUserStatePtr;
typedef std::vector<ItemUserStatePtr> ItemUserStates;

} // namespace Elements

#endif // ELEMENTS_ITEM_USER_STATE_H
